//
//  CashbackRecordSCell.m
//  NewPro
//
//  Created by 何荧红 on 2019/6/12.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "CashbackRecordSCell.h"

@interface CashbackRecordSCell ()

@property (weak, nonatomic) IBOutlet UILabel *minmoney;
@property (weak, nonatomic) IBOutlet UILabel *nextmoney;
@property (weak, nonatomic) IBOutlet UILabel *snnumber;
@property (weak, nonatomic) IBOutlet UILabel *state;
@property (weak, nonatomic) IBOutlet UILabel *POSType;
@property (weak, nonatomic) IBOutlet UILabel *timelabel;


@end


@implementation CashbackRecordSCell

- (void)setModel:(CashbackRecordModel *)model{
    _model = model;
    if (model) {
        self.minmoney.text = [NSString stringWithFormat:@"%@元",_model.sourceAmount];
        self.nextmoney.text = [NSString stringWithFormat:@"%@元",_model.backAmount];
        self.snnumber.text = _model.sn;
        if ([_model.status isEqualToString:@"1"]) {//1：待处理；2：已同意；3：已拒绝；4：已过期
            self.state.backgroundColor = [UIColor colorWithHexString:@"0CA6F0"];
            self.state.text = @"待处理";
        }else if ([_model.status isEqualToString:@"2"]) {
            self.state.backgroundColor = [UIColor colorWithHexString:@"189633"];
            self.state.text = @"已同意";
        }else if ([_model.status isEqualToString:@"3"]) {
            self.state.backgroundColor = [UIColor colorWithHexString:@"FF2929"];
            self.state.text = @"已拒绝";
        }else if ([_model.status isEqualToString:@"4"]) {
            self.state.backgroundColor = [UIColor colorWithHexString:@"999999"];
            self.state.text = @"已过期";
        }
        self.POSType.text = _model.category;
        self.timelabel.text = _model.updateTime;
    }
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
